import axios from "axios";

export async function updateVersion(version: number, lastCommit: string) {
    // Version update
    try {
        console.log(`Updating version: ${lastCommit}`);

        const response = await axios.get(
            `https://egypt-wss.lingame.cn/webrequest?func=setversion&=channelid=${lastCommit}&version=${version}`
        );

        console.log('Version update response:', response.data);
        console.log('Process completed successfully');
    } catch (err) {
        console.error('Version update failed:', err);
        process.exit(1);
    }
}